package com.example.postman.restful.controller;

import cn.shuibo.annotation.Decrypt;
import cn.shuibo.annotation.Encrypt;
import com.example.postman.restful.entity.User;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(("/user"))
public class EncryptController {

    /**
     * RSA 加密数据
     *
     * @return
     */
    @Encrypt
    @GetMapping("/encryptUser")
    @ResponseBody
    public User encryptUser(){
        User user = new User("1233", "3211", "222");
        user.setUserName("admin");
        user.setPhone("10081");
        return user;
    }

    @Decrypt
    @PostMapping("/decryptUser")
    public User decryptUser(String param){

        return null;
    }
}
